body {
  width: 100%;
  height: 100vh;
}

.element {
  position: relative;
  width: 150px;
  height: 130px;
  background: #f0ede8;
  border-radius: 8px;
  box-shadow: 0 2px 3px rgba(0, 0, 0, 0.1);
  display: inline-block;
  border: 1px solid #ccc;
}

.horiz-flag {
  position: absolute;
  background: linear-gradient(#9fbfdc, #3c74a6);
  display: inline-block;
  padding-right: 40px;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
  vertical-align: middle;
  height: 40px;
  line-height: 40px;
  left: -2px;
  padding-left: 10px;
  top: 10px;
  color: #fff;
}
.horiz-flag::before {
  content: "";
  position: absolute;
  display: block;
  height: 0;
  width: 0;
  border-style: solid;
  border-width: 20px;
  border-color: transparent;
  border-right-color: #f0ede8;
  right: -1px;
}
.horiz-flag::before {
  top: 0;
}

.vert-flag {
  position: absolute;
  background: linear-gradient(#e72929, #6b0c0c);
  display: inline-block;
  padding-bottom: 50px;
  box-shadow: 1px 0 1px rgba(0, 0, 0, 0.35);
  text-align: center;
  width: 50px;
  top: -2px;
  padding-top: 10px;
  left: 10px;
  color: #fff;
}
.vert-flag::before {
  content: "";
  position: absolute;
  display: block;
  height: 0;
  width: 0;
  border-style: solid;
  border-width: 25px;
  border-color: transparent;
  border-bottom-color: #f0ede8;
  bottom: -1px;
}
.vert-flag::before {
  left: 0;
}